home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 676-700 / 680 / atap / creating .metric files < prev    next >
Text File  |  1995-03-18  |  9KB  |  236 lines

  1. ================================================================
  2.  
  3.                       Creating .metric files
  4.  
  5. ================================================================
  6.  
  7. Like I described in "ReadMeFirst.doc", Professional Page gets its spacing info
  8. from .metric files. It also gets kerning information, PostSript typeface
  9. names, and other little tidbits. 
  10.  
  11. Adobe Font Metrics files (AFMs) also contain this kind of info, but PPage
  12. doesn't use them. Hence, ConvertAFM. 
  13.  
  14. ================================================================
  15.  
  16.                       Using ConvertAFM
  17.  
  18. ================================================================
  19.  
  20. Since a .metric may hold information for up to four typefaces for styles of
  21. plain, bold, italic, and bolditalic, ConvertAFM can take up to four AFM files
  22. in its command line. Say we have a collection of AFMs for the typeface family
  23. ITC Garamond:
  24.  
  25. Filename     PostScript typeface name
  26. =====================================
  27. GL______.AFM (Garamond-Light)
  28. GB______.AFM (Garamond-Bold)
  29. GLI_____.AFM (Garamond-LightItalic)
  30. GBI_____.AFM (Garamond-BoldItalic)
  31.  
  32. (Based on filenames for the MS-DOS version of ITC Garamond)
  33.  
  34. To make a .metric called Garamond.metric, we use ConvertAFM like this:
  35.  
  36. 1.MSDOS3.3> ConvertAFM GL______.AFM GB______.AFM GLI_____.AFM GBI_____.AFM
  37.  
  38. (Based on the files sitting on DI0: with CrossDOS running)
  39.  
  40. This will write a .metric file on the current directory named
  41. "Garamond.metric". It generates the filename from the PostScript typeface
  42. names by stripping off the style extensions and adding .metric to the
  43. result.
  44.  
  45. /* NOTE: If you did this directly on an MS-DOS disk using CrossDOS, the actual
  46. filename will be "GARAMON.MET" because CrossDOS shortens the name to fit
  47. MS-DOS filename conventions. If this is the case, simply do a copy:
  48.  
  49. 1.MSDOS3.3> copy garamon.met fonts:Garamond.metric
  50.  
  51. since the .metric has to go to FONTS: anyway. Please capitalize the name. */
  52.  
  53. We can also specify a different .metric filename and path:
  54.  
  55. 1.MSDOS3.3> ConvertAFM GL.AFM GB.AFM GLI.AFM GBI.AFM FONTS:Garamond.metric
  56.  
  57. as well as specify different paths for the AFMs:
  58.  
  59. 1.MSDOS3.3> CD FONTS:
  60. 1.SCSI Device:FONTS> ConvertAFM DI0:GL.AFM DI0:GB.AFM DI0:GLI.AFM DI0:GBI.AFM
  61.  
  62. This second example would write Garamond.metric to the directory currently
  63. assigned as FONTS:.
  64.  
  65. ConvertAFM reports the typeface names and order they were entered in,
  66. as well as the .metric filename:
  67.  
  68. Typefaces chosen for Garamond.metric:
  69. =====================================
  70. Regular:    Garamond-Light
  71. Bold:       Garamond-Bold
  72. Italic:     Garamond-LightItalic
  73. BoldItalic: Garamond-BoldItalic
  74. =====================================
  75.  
  76. so if you screwed up the order, you can abort with CTRL-C and re-enter the
  77. command. AmigaShell's command history (cursor-up) really helps here.
  78.  
  79. As it churns through each AFM it gives little progress reports, because
  80. converting an AFM can take some time depending on how many kerning pairs
  81. are available, and I don't want you to think I write buggy software. :-)
  82.  
  83. Processed Garamond-Light
  84. Processed Garamond-Bold
  85. Processed Garamond-LightItalic
  86. Processed Garamond-BoldItalic
  87. ======================================
  88. Garamond.metric Complete.
  89.  
  90. ConvertAFM automatically recognizes AFMs that use Adobe Standard, Apple
  91. Standard, or Font Specific encoding. If the AFM uses Adobe Standard or 
  92. any other encoding scheme, the characters are re-mapped to match the Amiga
  93. character set. This is only crucial for characters between ASCII 161 and 255.
  94. If the AFM uses Apple Standard encoding (typical of public domain typefaces
  95. available for the Macintosh) or Font Specific encoding, they are mapped
  96. as directly listed by ASCII code, and they're treated as "FONT_SPECIFIC" by
  97. Professional Page. This way, the .metric file matches Macintosh screen fonts.
  98. This is a signficant improvment over my BASIC version. Font Specific encoded
  99. typefaces include ZapfDingbats, Symbol, Sonata, or other similar symbol sets
  100. or special character sets.
  101.  
  102. Kerning pairs are also closely recorded. Since they're listed by character
  103. name in the AFM, the kerning info is also dependant on the encoding scheme.
  104. Font Specific encoded typefaces usually don't have kerning info, and if they
  105. do, it's ignored by ConvertAFM. Apple Standard encoded AFMs' kerning
  106. tables are valid between ASCII 32 and 127 (IE: The normal charset). Adobe
  107. Standard and others have valid kerning across the entire ASCII range.
  108.  
  109.                        Custom .metric Organizations
  110.  
  111. Not all typeface families have just four typefaces for regular, bold, etc.
  112. so ConvertAFM allows for custom .metric files with fewer AFMs converted.
  113.  
  114. Take Adobe Garamond for example:
  115.  
  116. AGaramond-Regular
  117. AGaramond-Italic
  118. AGaramond-SemiBold
  119. AGaramond-SemiBoldItalic
  120. AGaramond-Bold
  121. AGaramond-BoldItalic
  122.  
  123. /* NOTE: Adobe Garamond has 600+ (!) kerning pairs for each typeface, and
  124. ConvertAFM handles these nicely! */
  125.  
  126. You obviously can't squeeze six AFMs into one .metric (That's lack of
  127. foresight for you, Gold Disk!) So, I like to group the differet weights
  128. with their matching italics. The result: three unique .metric files.
  129.  
  130. We can omit a style by inserting a dummy filename (in this case an "x"):
  131.  
  132. 1.AFM Disk:> ConvertAFM AGR.AFM x AGI.AFM x AdobeGaramond.metric
  133.  
  134. I specified a different .metric filename because the basenames of all these
  135. typefaces are all the same, and the next .metric would overwrite the last 
  136. otherwise! Do the same for the other two weights:
  137.  
  138. 1.AFM Disk:> ConvertAFM AGSB.AFM x AGSBI.AFM x AdobeGaramondSemiBold.metric
  139.  
  140. 1.AFM Disk:> ConvertAFM AGB.AFM x AGBI.AFM x AdobeGaramondBold.metric
  141.  
  142. A progress report for one of these would look like this:
  143.  
  144. Typefaces chosen for AdobeGaramond.metric:
  145. =====================================
  146. Regular:    AGaramond-Regular
  147. Bold:       (No .AFM Given)
  148. Italic:     AGaramond-Italic
  149. BoldItalic: (No .AFM Given)
  150. =====================================
  151. Processed AGaramond-Regular
  152. Processed AGaramond-Italic
  153. =====================================
  154. AdobeGaramond.metric Complete.
  155.  
  156. Match these up with the different weights of screen fonts and you have a good
  157. working combo. BTW, Adobe Systems DOES supply screen fonts for EACH AND EVERY
  158. typeface they publish, including different weights and italic versions.
  159.  
  160. For single typeface families, such as Linoscript, you can omit the other
  161. three AFM entries easily:
  162.  
  163. 1.AFM Disk:> ConvertAFM LinoScr.AFM x x x
  164.  
  165.                         Unusually Named Families
  166.  
  167. Numbered typefaces become hell for ConvertAFM. It can't extract its own
  168. .metric filename because the typeface weight number is part of the basename!
  169. Take Calson for example:
  170.  
  171. Calson540-Roman
  172. Calson3-Roman
  173. Calson540-Italic
  174. Calson3-Italic
  175.  
  176. They're in the right order (Regular, bold, etc.) and they can fit into one
  177. .metric, but ConvertAFM will complain. Supplying an alternale .metric filename
  178. will override this check:
  179.  
  180. 1.AFM Disk:> ConvertAFM C540R.AFM C3R.AFM C540I.AFM C3I.AFM Calson.metric
  181.  
  182. If you're one style short, that's OK. Look at Goudy Extra Bold:
  183.  
  184. Goudy-ExtraBold
  185. Goudy-Heavyface
  186. Goudy-HeavyfaceItalic
  187.  
  188. Just do this:
  189.  
  190. 1.AFM Disk:> ConvertAFM GEB.AFM x GH.AFM GHI.AFM GoudyXBold&Heavyface.metric
  191.  
  192. You don't need the alternate filename this time, but just in case you had
  193. the original Goudy series, this won't overwrite it.
  194.  
  195.               The golden rules for .metric organization are:
  196.               ==============================================
  197.  
  198. 1) Keey typeface families together. Don't supply alternate .metric filenames
  199. unless you REALLY want these typefaces in one .metric. Let the basename check
  200. work for you.
  201.  
  202. 2) For large families, separate into weights. Keep regulars with italics,
  203. and use logical .metric filenames. Don't be afraid to use long filenames.
  204.  
  205. 3) Beware of numbered typefaces. Read the AFMs to make sure they belong
  206. to the same family, and make sure you enter them in the right order.
  207.  
  208. 4) If you add new weights to a family you have (like Helvetica) you should
  209. reorganize your .metrics into different weights as per 2), just to keep
  210. things organized. This means, Don't put:
  211.  
  212. Helvetica25-UltraLight
  213. Helvetica95-Black
  214. Helvetica26-UltraLightItalic
  215. Helvetica96-BlackItalic
  216.  
  217. into one .metric. It'll work OK, but you'll lose youself looking for those
  218. heavier weights.
  219.  
  220. 5) Keep screen font names and .metric names matched! If you convert a screen
  221. font called "AdobeGaramond", make sure the .metric filename is 
  222. "AdobeGaramond.metric". Basic rule.
  223.  
  224. End of this one. Included are two sample AFMs, one with AdobeStandard encoding
  225. and one with Font Specific. In case you have a problem with a particular AFM,
  226. compare it to these two examples. If they don't match, or if one keyword is
  227. out of place, simply move it to the correct position. AFMs are simply text
  228. files, and are editable with ED, MEmacs, or any word processor.
  229.  
  230. FINAL NOTE ON TEXT TRANSLATION: Since AFMs are text files, they're subject
  231. to different end-of-line rules between operating systems. ConvertAFM will
  232. work with AFM files with Amiga (Linefeed only), Macintosh (Carriage Return
  233. only), or MS-DOS (Carriage Return plus Linefeed) EOL marks. This was inherent
  234. in the BASIC version, and I felt I had to include it in the C version, too. 
  235.  
  236.